<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file = "lianjie.jsp" %>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

	
		 <%
		 	String book_ISBN = request.getParameter("book_ISBN");
		 
				String ISBN = ""; //
				String modify_bookname = ""; //
				String author = ""; //
				String type = ""; //
				String press = ""; //
				float price = 0 ; //
				int surplus = 0 ;//
				int num = 0;
				String sql = "select * from booksmassage where ISBN = '" + book_ISBN + "'";
				ResultSet rs2 = stmt.executeQuery(sql);
				if(!rs2.next()){
					out.print("该书不存在");
					response.setHeader("Refresh", "1;URL=delete_book.jsp");
				}else{
					ISBN = rs2.getString("ISBN");
					modify_bookname = rs2.getString("name");
					author = rs2.getString("author");
					type = rs2.getString("type");
					press = rs2.getString("press");
					price = rs2.getFloat("price");
					surplus = rs2.getInt("surplus");
				}
			%>
			<form name = "fm1" id="fm1">
	<table   border="1" cellspacing="0" cellpadding="3" align = "center">
	                  
			<tr>
				<td width="20%">ISBN</td>
				<td>
					<input type = "text" name = "ISBN" id = "ISBN" value = "<%=ISBN%>" disabled>
				</td>
			</tr>
			<tr>
				<td width="20%">书名</td>
				<td>
				<input type = "text" name = "bookname" id = "bookname" value = "<%=modify_bookname%>"disabled>
				</td>
			</tr>
			<tr>
				<td width="20%">作者</td>
				<td>
				<input type = "text" name = "author" id = "author" value = "<%=author%>"disabled>
				</td>
			</tr>
			<tr>
				<td width="20%">类型</td>
				<td>
				<input type = "text" name = "type" id = "type" value = "<%=type%>" disabled>
				</td>
			</tr>
			<tr>
				<td width="20%">出版社</td>
				<td>
					<input type = "text" name = "press" id = "press" value = "<%=press%>"disabled>
				</td>
			</tr>
			<tr>
				<td width="20%">价钱</td>
				<td>
					<input type = "text" name = "price" id = "price" value = "<%=price%>"disabled>
				</td>
			</tr>
			<tr>
				<td width="20%">余量</td>
				<td>
					<input type = "text" name = "surplus" id = "surplus" value = "<%=surplus%>"disabled>
				</td>
			</tr>
		</table>
		<br><br>
			<div align = "center" >
				<input type = "submit" name = "submit"  value = "删除" onClick = "submitdelete()" style = "font-size:30px;"/>
				<input type = "submit" name = "back1"  value = "返回" onClick = "back_last()" style = "font-size:30px;"/>
			</div>
			<%session.setAttribute("ISBN", ISBN); %>
			
</form>
</body>
</html>


<script>
	function submitdelete(){
		if(!confirm("提示，您是否要删除此书籍吗？")){
			return;
		}
		document.fm1.method = "post";
		document.fm1.action = "delete_do_submit2.jsp";
		document.fm1.submit();
	}
	function back_last(){
		document.fm.method = "post";
		document.fm.action = "modify_do.jsp";
		document.fm.submit();
	}  
	
	
</script>

